home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / doc / windows.txt < prev    next >
Encoding:
Text File  |  2001-09-26  |  44.2 KB  |  1,106 lines

  1. *windows.txt*   For Vim version 6.0.  Last change: 2001 Sep 03
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Bram Moolenaar
  5.  
  6.  
  7. Editing with multiple windows and buffers.        *windows* *buffers*
  8.  
  9. The commands which have been added to use multiple windows and buffers are
  10. explained here.  Additionally, there are explanations for commands that work
  11. differently when used in combination with more than one window.
  12.  
  13. The basics are explained in chapter 7 and 8 of the user manual |usr_07.txt|
  14. |usr_08.txt|.
  15.  
  16. 1.  Introduction                |windows-intro|
  17. 2.  Starting Vim                |windows-starting|
  18. 3.  Opening and closing a window        |opening-window|
  19. 4.  Moving cursor to other windows        |window-move-cursor|
  20. 5.  Moving windows around            |window-moving|
  21. 6.  Window resizing                |window-resize|
  22. 7.  argument and buffer list commands        |buffer-list|
  23. 8.  Do a command in all buffers or windows    |list-repeat|
  24. 9.  Tag or file name under the cursor        |window-tag|
  25. 10. The preview window                |preview-window|
  26. 11. Using hidden buffers            |buffer-hidden|
  27. 12. Special kinds of buffers            |special-buffers|
  28.  
  29. {Vi does not have any of these commands}
  30. {not able to use multiple windows when the |+windows| feature was disabled at
  31. compile time}
  32. {not able to use vertically split windows when the |+vertsplit| feature was
  33. disabled at compile time}
  34.  
  35. ==============================================================================
  36. 1. Introduction                        *windows-intro*
  37.  
  38. A window is a viewport onto a buffer.  You can use multiple windows on one
  39. buffer, or several windows on different buffers.
  40.  
  41. A buffer is a file loaded into memory for editing.  The original file remains
  42. unchanged until you write the buffer to the file.
  43.  
  44. A buffer can be in one of three states:
  45.  
  46.                             *active-buffer*
  47. active:   The buffer is displayed in a window.  If there is a file for this
  48.       buffer, it has been read into the buffer.  The buffer may have been
  49.       modified since then and thus be different from the file.
  50.                             *hidden-buffer*
  51. hidden:   The buffer is not displayed.  If there is a file for this buffer, it
  52.       has been read into the buffer.  Otherwise it's the same as an active
  53.       buffer, you just can't see it.
  54.                             *inactive-buffer*
  55. inactive: The buffer is not displayed and does not contain anything.  Options
  56.       for the buffer are remembered if the file was once loaded.  It can
  57.       contains marks from the |viminfo| file.  But the buffer doesn't
  58.       contain text.
  59.  
  60. In a table:
  61.  
  62. state        displayed    loaded        ":buffers"  ~
  63.         in window            shows        ~
  64. active          yes         yes          'a'
  65. hidden          no         yes          'h'
  66. inactive      no         no          ' '
  67.  
  68. Note: All CTRL-W commands can also be executed with |:wincmd|, for those
  69. places where a Normal mode command can't be used or is inconvenient.
  70.  
  71. ==============================================================================
  72. 2. Starting Vim                        *windows-starting*
  73.  
  74. By default, Vim starts with one window, just like Vi.
  75.  
  76. The "-o" and "-O" arguments to Vim can be used to open a window for each file
  77. in the argument list.  The "-o" argument will split the windows horizontally;
  78. the "-O" argument will split the windows vertically.  If both "-o" and "-O"
  79. are given, the last one encountered will be used to determine the split
  80. orientation.  For example, this will open three windows, split horizontally: >
  81.     Vim -o file1 file2 file3
  82.  
  83. "-oN", where N is a decimal number, opens N windows split horizontally.  If
  84. there are more file names than windows, only N windows are opened and some
  85. files do not get a window.  If there are more windows than file names, the
  86. last few windows will be editing empty buffers.  Similarly, "-ON" opens N
  87. windows split vertically, with the same restrictions.
  88.  
  89. If there are many file names, the windows will become very small.  You might
  90. want to set the 'winheight' and/or 'winwidth' options to create a workable
  91. situation.
  92.  
  93. Buf/Win Enter/Leave |autocommand|s are not executed when opening the new
  94. windows and reading the files, that's only done when they are really entered.
  95.  
  96.                             *status-line*
  97. A status line will be used to separate windows.  The 'laststatus' option tells
  98. when the last window also has a status line:
  99.     'laststatus' = 0    never a status line
  100.     'laststatus' = 1    status line if there is more than one window
  101.     'laststatus' = 2    always a status line
  102.  
  103. You can change the contents of the status line with the 'statusline' option.
  104.  
  105. Normally, inversion is used to display the status line.  This can be changed
  106. with the 's' character in the 'highlight' option.  For example, "sb" sets it to
  107. bold characters.  If no highlighting is used for the status line ("sn"), the
  108. '^' character is used for the current window, and '=' for other windows.  If
  109. the mouse is supported and enabled with the 'mouse' option, a status line can
  110. be dragged to resize windows.
  111.  
  112. Note: If you expect your status line to be in reverse video and it isn't,
  113. check if the 'highlight' option contains "si".  In version 3.0, this meant to
  114. invert the status line.  Now it should be "sr", reverse the status line, as
  115. "si" now stands for italic!  If italic is not available on your terminal, the
  116. status line is inverted anyway; you will only see this problem on terminals
  117. that have termcap codes for italics.
  118.  
  119. ==============================================================================
  120. 3. Opening and closing a window                *opening-window* *E36*
  121.  
  122. CTRL-W s                        *CTRL-W_s*
  123. CTRL-W S                        *CTRL-W_S*
  124. CTRL-W CTRL-S                        *CTRL-W_CTRL-S*
  125. :[N]sp[lit] [++opt] [+cmd]                *:sp* *:split*
  126.         Split current window in two.  The result is two viewports on
  127.         the same file.  Make new window N high (default is to use half
  128.         the height of the current window).  Reduces the current window
  129.         height to create room (and others, if the 'equalalways' option
  130.         is set and 'eadirection' isn't "hor").
  131.         Note: CTRL-S does not work on all terminals and might block
  132.         further input, use CTRL-Q to get going again.
  133.         Also see |++opt| and |+cmd|.
  134.  
  135. CTRL-W CTRL-V                        *CTRL-W_CTRL-V*
  136. CTRL-W v                        *CTRL-W_v*
  137. :[N]vs[plit] [++opt] [+cmd] [file]            *:vs* *:vsplit*
  138.         Like |:split|, but split vertically.  If 'equalalways' is set
  139.         and 'eadirection' isn't "ver" the windows will be spread out
  140.         horizontally, unless a width was specified.
  141.  
  142. CTRL-W n                        *CTRL-W_n*
  143. CTRL-W CTRL_N                        *CTRL-W_CTRL-N*
  144. :[N]new [++opt] [+cmd]                    *:new*
  145.         Create a new window and start editing an empty file in it.
  146.         Make new window N high (default is to use half the existing
  147.         height).  Reduces the current window height to create room (and
  148.         others, if the 'equalalways' option is set and 'eadirection'
  149.         isn't "hor").
  150.         Also see |++opt| and |+cmd|.
  151.         If 'fileformats' is not empty, the first format given will be
  152.         used for the new buffer.  If 'fileformats' is empty, the
  153.         'fileformat' of the current buffer is used.  This can be
  154.         overridden with the |++opt| argument.
  155.         Autocommands are executed in this order:
  156.         1. WinLeave for the current window
  157.         2. WinEnter for the new window
  158.         3. BufLeave for the current buffer
  159.         4. BufEnter for the new buffer
  160.         This behaves like a ":split" first, and then a ":e" command.
  161.  
  162. :[N]vne[w] [++opt] [+cmd] [file]            *:vne* *:vnew*
  163.         Like |:new|, but split vertically.  If 'equalalways' is set
  164.         and 'eadirection' isn't "ver" the windows will be spread out
  165.         horizontally, unless a width was specified.
  166.  
  167. :[N]new [++opt] [+cmd] {file}
  168. :[N]sp[lit] [++opt] [+cmd] {file}            *:split_f*
  169.         Create a new window and start editing file {file} in it.
  170.         If [+cmd] is given, execute the command when the file has been
  171.         loaded |+cmd|.
  172.         Also see |++opt|.
  173.         Make new window N high (default is to use half the existing
  174.         height).  Reduces the current window height to create room
  175.         (and others, if the 'equalalways' option is set).
  176.  
  177. :[N]sv[iew] [++opt] [+cmd] {file}        *:sv* *:sview* *splitview*
  178.         Same as ":split", but set 'readonly' option for this buffer.
  179.  
  180. :[N]sf[ind] [++opt] [+cmd] {file}        *:sf* *:sfind* *splitfind*
  181.         Same as ":split", but search for {file} in 'path'.  Doesn't
  182.         split if {file} is not found.
  183.  
  184. CTRL-W CTRL-^                    *CTRL-W_CTRL-^* *CTRL-W_^*
  185. CTRL-W ^    Does ":split #", split window in two and edit alternate file.
  186.         When a count is given, it becomes ":split #N", split window
  187.         and edit buffer N.
  188.  
  189. Note that the 'splitbelow' and 'splitright' options influence where a new
  190. window will appear.
  191.  
  192.                         *:vert* *:vertical*
  193. :vert[ical] {cmd}
  194.         Execute {cmd}.  If it contains a command that splits a window,
  195.         it will be split vertically.
  196.  
  197. :lefta[bove] {cmd}                *:lefta* *leftabove*
  198. :abo[veleft] {cmd}                *:abo* *:aboveleft*
  199.         Execute {cmd}.  If it contains a command that splits a window,
  200.         it will be opened left (vertical split) or above (horizontal
  201.         split) the current window.  Overrules 'splitbelow' and
  202.         'splitright'.
  203.  
  204. :rightb[elow] {cmd}                *:rightb* *:rightbelow*
  205. :bel[owright] {cmd}                *:bel* *:belowright*
  206.         Execute {cmd}.  If it contains a command that splits a window,
  207.         it will be opened right (vertical split) or below (horizontal
  208.         split) the current window.  Overrules 'splitbelow' and
  209.         'splitright'.
  210.  
  211.                         *:topleft* *E442*
  212. :to[pleft] {cmd}
  213.         Execute {cmd}.  If it contains a command that splits a window,
  214.         it will appear at the top and occupy the full width of the Vim
  215.         window.  When the split is vertical the window appears at the
  216.         far left and occupies the full height of the Vim window.
  217.  
  218.                         *:botright*
  219. :bo[tright] {cmd}
  220.         Execute {cmd}.  If it contains a command that splits a window,
  221.         it will appear at the bottom and occupy the full width of the
  222.         Vim window.  When the split is vertical the window appears at
  223.         the far right and occupies the full height of the Vim window.
  224.  
  225. These command modifers can be combined to make a vertically split window
  226. occupy the full height.  Example: >
  227.     :vertical topleft edit tags
  228. Opens a vertically split, full-height window on the "tags" file at the far
  229. left of the Vim window.
  230.  
  231.  
  232. Closing a window
  233. ----------------
  234.  
  235. CTRL-W q                        *CTRL-W_q*
  236. CTRL-W CTRL-Q                        *CTRL-W_CTRL-Q*
  237. :q[uit]        Quit current window.  When quitting the last window (not
  238.         counting a help window), exit Vim.
  239.         When 'hidden' is set, and there is only one window for the
  240.         current buffer, it becomes hidden.
  241.         When 'hidden' is not set, and there is only one window for the
  242.         current buffer, and the buffer was changed, the command fails.
  243.         (Note: CTRL-Q does not work on all terminals)
  244.  
  245. :q[uit]!    Quit current window.  If this was the last window for a buffer,
  246.         any changes to that buffer are lost.  When quitting the last
  247.         window (not counting help windows), exit Vim.  The contents of
  248.         the buffer are lost, even when 'hidden' is set.
  249.  
  250. CTRL-W c                    *CTRL-W_c* *:clo* *:close*
  251. :clo[se][!]    Close current window.  When the 'hidden' option is set, or
  252.         when the buffer was changed and the [!] is used, the buffer
  253.         becomes hidden (unless there is another window editing it).
  254.         This command fails when:            *E444*
  255.         - There is only one window on the screen.
  256.         - When 'hidden' is not set, [!] is not used, the buffer has
  257.           changes, and there is no other window on this buffer.
  258.         Changes to the buffer are not written and won't get lost, so
  259.         this is a "safe" command.
  260.  
  261. CTRL-W CTRL-C                        *CTRL-W_CTRL-C*
  262.         You might have expected that CTRL-W CTRL-C closes the current
  263.         window, but that does not work, because the CTRL-C cancels the
  264.         command.
  265.  
  266.                             *:hide*
  267. :hid[e]        Quit current window, unless it is the last window on the
  268.         screen.  The buffer becomes hidden (unless there is another
  269.         window editing it or 'bufhidden' is "unload" or "delete").
  270.         The value of 'hidden' is irrelevant for this command.
  271.         Changes to the buffer are not written and won't get lost, so
  272.         this is a "safe" command.
  273.  
  274. :hid[e] {cmd}    Execute {cmd} with 'hidden' is set.  The previous value of
  275.         'hidden' is restored after {cmd} has been executed.
  276.         Example: >
  277.             :hide edit Makefile
  278. <        This will edit "Makefile", and hide the current buffer if it
  279.         has any changes.
  280.  
  281. CTRL-W o                        *CTRL-W_o* *E445*
  282. CTRL-W CTRL-O                    *CTRL-W_CTRL-O* *:on* *:only*
  283. :on[ly][!]    Make the current window the only one on the screen.  All other
  284.         windows are closed.
  285.         When the 'hidden' option is set, all buffers in closed windows
  286.         become hidden.
  287.         When 'hidden' is not set, and the 'autowrite' option is set,
  288.         modified buffers are written.  Otherwise, windows that have
  289.         buffers that are modified are not removed, unless the [!] is
  290.         given, then they become hidden.  But modified buffers are
  291.         never abandoned, so changes cannot get lost.
  292.  
  293. ==============================================================================
  294. 4. Moving cursor to other windows            *window-move-cursor*
  295.  
  296. CTRL-W <Down>                    *CTRL-W_<Down>*
  297. CTRL-W CTRL-J                    *CTRL-W_CTRL-J* *CTRL-W_j*
  298. CTRL-W j    Move cursor to Nth window below current one.  Uses the cursor
  299.         position to select between alternatives.
  300.  
  301. CTRL-W <Up>                    *CTRL-W_<Up>*
  302. CTRL-W CTRL-K                    *CTRL-W_CTRL-K* *CTRL-W_k*
  303. CTRL-W k    Move cursor to Nth window above current one.  Uses the cursor
  304.         position to select between alternatives.
  305.  
  306. CTRL-W <Left>                    *CTRL-W_<Left>*
  307. CTRL-W CTRL-H                    *CTRL-W_CTRL-H*
  308. CTRL-W <BS>                    *CTRL-W_<BS>* *CTRL-W_h*
  309. CTRL-W h    Move cursor to Nth window left of current one.  Uses the
  310.         cursor position to select between alternatives.
  311.  
  312. CTRL-W <Right>                    *CTRL-W_<Right>*
  313. CTRL-W CTRL-L                    *CTRL-W_CTRL-L* *CTRL-W_l*
  314. CTRL-W l    Move cursor to Nth window right of current one.  Uses the
  315.         cursor position to select between alternatives.
  316.  
  317. CTRL-W w                    *CTRL-W_w* *CTRL-W_CTRL-W*
  318. CTRL-W CTRL-W    Without count: move cursor to window below/right of the
  319.         current one.  If there is no window below or right, go to
  320.         top-left window.  With count: go to Nth window (windows are
  321.         numbered from top-left to bottom-right).
  322.  
  323.                         *CTRL-W_W*
  324. CTRL-W W    Without count: move cursor to window above/left of current
  325.         one.  If there is no window above or left, go to bottom-right
  326.         window.  With count: go to Nth window (windows are numbered
  327.         from top-left to bottom-right).
  328.  
  329. CTRL-W t                    *CTRL-W_t* *CTRL-W_CTRL-T*
  330. CTRL-W CTRL-T    Move cursor to top-left window.
  331.  
  332. CTRL-W b                    *CTRL-W_b* *CTRL-W_CTRL-B*
  333. CTRL-W CTRL-B    Move cursor to bottom-right window.
  334.  
  335. CTRL-W p                    *CTRL-W_p* *CTRL-W_CTRL-P*
  336. CTRL-W CTRL-P    Go to previous (last accessed) window.
  337.  
  338.                         *CTRL-W_P* *E441*
  339. CTRL-W P    Go to preview window.  When there is no preview window this is
  340.         an error.
  341.         {not available when compiled without the |+quickfix| feature}
  342.  
  343. If Visual mode is active and the new window is not for the same buffer, the
  344. Visual mode is ended.  If the window is on the same buffer, the cursor
  345. position is set to keep the same Visual area selected.
  346.  
  347.                         *:winc* *:wincmd*
  348. These commands can also be executed with ":wincmd":
  349.  
  350. :[count]winc[md] {arg}
  351.         Like executing CTRL-W [count] {arg}.  Example: >
  352.             :wincmd j
  353. <        Moves to the window below the current one.
  354.         This command is useful when a Normal mode cannot be used (for
  355.         the |CursorHold| autocommand event).  Or when a Normal mode
  356.         command is inconvenient.
  357.  
  358. ==============================================================================
  359. 5. Moving windows around                *window-moving*
  360.  
  361. CTRL-W r                *CTRL-W_r* *CTRL-W_CTRL-R* *E443*
  362. CTRL-W CTRL-R    Rotate windows downwards/rightwards.  The first window becomes
  363.         the second one, the second one becomes the third one, etc.
  364.         The last window becomes the first window.  The cursor remains
  365.         in the same window.
  366.         This only works within the row or column of windows that the
  367.         current window is in.
  368.  
  369.                         *CTRL-W_R*
  370. CTRL-W R    Rotate windows upwards/leftwards.  The second window becomes
  371.         the first one, the third one becomes the second one, etc.  The
  372.         first window becomes the last window.  The cursor remains in
  373.         the same window.
  374.         This only works within the row or column of windows that the
  375.         current window is in.
  376.  
  377. CTRL-W x                    *CTRL-W_x* *CTRL-W_CTRL-X*
  378. CTRL-W CTRL-X    Without count: Exchange current window with next one.  If there
  379.         is no next window, exchange with previous window.
  380.         With count: Exchange current window with Nth window (first
  381.         window is 1).  The cursor is put in the other window.
  382.         When vertical and horizontal window splits are mixed, the
  383.         exchange is only done in the row or column of windows that the
  384.         current window is in.
  385.  
  386. The following commands can be used to change the window layout.  For example,
  387. when there are two vertically split windows, CTRL-W K will change that in
  388. horizontally split windows.  CTRL-W H does it the other way around.
  389.  
  390.                         *CTRL-W_K*
  391. CTRL-W K    Move the current window to be at the very top, using the full
  392.         width of the screen.  This works like closing the current
  393.         window and then creating another one with ":topleft split",
  394.         except that the current window contents is used for the new
  395.         window.
  396.  
  397.                         *CTRL-W_J*
  398. CTRL-W J    Move the current window to be at the very bottom, using the
  399.         full width of the screen.  This works like closing the current
  400.         window and then creating another one with ":botright split",
  401.         except that the current window contents is used for the new
  402.         window.
  403.  
  404.                         *CTRL-W_H*
  405. CTRL-W H    Move the current window to be at the far left, using the
  406.         full height of the screen.  This works like closing the
  407.         current window and then creating another one with
  408.         ":vert topleft split", except that the current window contents
  409.         is used for the new window.
  410.         {not available when compiled without the +vertsplit feature}
  411.  
  412.                         *CTRL-W_L*
  413. CTRL-W L    Move the current window to be at the far right, using the full
  414.         height of the screen.  This works like closing the
  415.         current window and then creating another one with
  416.         ":vert botright split", except that the current window
  417.         contents is used for the new window.
  418.         {not available when compiled without the +vertsplit feature}
  419.  
  420. ==============================================================================
  421. 6. Window resizing                    *window-resize*
  422.  
  423.                         *CTRL-W_=*
  424. CTRL-W =    Make all windows (almost) equally high and wide, but use
  425.         'winheight' and 'winwidth' for the current window.
  426.  
  427. :res[ize] -N                    *:res* *:resize* *CTRL-W_-*
  428. CTRL-W -    Decrease current window height by N (default 1).
  429.         If used after 'vertical': decrease width by N.
  430.  
  431. :res[ize] +N                    *CTRL-W_+*
  432. CTRL-W +    Increase current window height by N (default 1).
  433.         If used after 'vertical': increase width by N.
  434.  
  435. :res[ize] [N]
  436. CTRL-W CTRL-_                    *CTRL-W_CTRL-_* *CTRL-W__*
  437. CTRL-W _    Set current window height to N (default: highest possible).
  438.  
  439. z{nr}<CR>    Set current window height to {nr}.
  440.  
  441.                         *CTRL-W_<*
  442. CTRL-W <    Decrease current window width by N (default 1).
  443.  
  444.                         *CTRL-W_>*
  445. CTRL-W >    Increase current window width by N (default 1).
  446.  
  447. :vertical res[ize] [N]            *:vertical-resize* *CTRL-W_bar*
  448. CTRL-W |    Set current window width to N (default: widest possible).
  449.  
  450. You can also resize a window by dragging a status line up or down with the
  451. mouse.  Or by dragging a vertical separator line left or right.  This only
  452. works if the version of Vim that is being used supports the mouse and the
  453. 'mouse' option has been set to enable it.
  454.  
  455. The option 'winheight' ('wh') is used to set the minimal window height of the
  456. current window.  This option is used each time another window becomes the
  457. current window.  If the option is '0', it is disabled.  Set 'winheight' to a
  458. very large value, e.g., '9999', to make the current window always fill all
  459. available space.  Set it to a reasonable value, e.g., '10', to make editing in
  460. the current window comfortable.
  461.  
  462. The equivalent 'winwidth' ('wiw') option is used to set the minimal width of
  463. the current window.
  464.  
  465. When the option 'equalalways' ('ea') is set, all the windows are automatically
  466. made the same size after splitting or closing a window.  If you don't set this
  467. option, splitting a window will reduce the size of the current window and
  468. leave the other windows the same.  When closing a window, the extra lines are
  469. given to the window above it.
  470.  
  471. The 'eadirection' option limits the direction in which the 'equalalways'
  472. option is applied.  The default "both" resizes in both directions.  When the
  473. value is "ver" only the heights of windows are equalized.  Use this when you
  474. have manually resized a vertically split window and want to keep this width.
  475. Likewise, "hor" causes only the widths of windows to be equalized.
  476.  
  477. The option 'cmdheight' ('ch') is used to set the height of the command-line.
  478. If you are annoyed by the |hit-enter| prompt for long messages, set this
  479. option to 2 or 3.
  480.  
  481. If there is only one window, resizing that window will also change the command
  482. line height.  If there are several windows, resizing the current window will
  483. also change the height of the window below it (and sometimes the window above
  484. it).
  485.  
  486. The minimal height and width of a window is set with 'winminheight' and
  487. 'winminwidth'.  These are hard values, a window will never become smaller.
  488.  
  489. ==============================================================================
  490. 7. argument and buffer list commands            *buffer-list*
  491.  
  492.       args list               buffer list       meaning ~
  493. 1. :[N]argument [N]    11. :[N]buffer [N]    to arg/buf N
  494. 2. :[N]next [file ..]    12. :[N]bnext [N]    to Nth next arg/buf
  495. 3. :[N]Next [N]        13. :[N]bNext [N]    to Nth previous arg/buf
  496. 4. :[N]previous    [N]    14. :[N]bprevious [N]    to Nth previous arg/buf
  497. 5. :rewind / :first    15. :brewind / :bfirst    to first arg/buf
  498. 6. :last        16. :blast        to last arg/buf
  499. 7. :all            17. :ball        edit all args/buffers
  500.             18. :unhide        edit all loaded buffers
  501.             19. :[N]bmod [N]    to Nth modified buf
  502.  
  503.   split & args list      split & buffer list       meaning ~
  504. 21. :[N]sargument [N]   31. :[N]sbuffer [N]    split + to arg/buf N
  505. 22. :[N]snext [file ..] 32. :[N]sbnext [N]      split + to Nth next arg/buf
  506. 23. :[N]sNext [N]       33. :[N]sbNext [N]      split + to Nth previous arg/buf
  507. 24. :[N]sprevious [N]   34. :[N]sbprevious [N]  split + to Nth previous arg/buf
  508. 25. :srewind / :sfirst    35. :sbrewind / :sbfirst split + to first arg/buf
  509. 26. :slast        36. :sblast        split + to last arg/buf
  510. 27. :sall        37: :sball        edit all args/buffers
  511.             38. :sunhide        edit all loaded buffers
  512.             39. :[N]sbmod [N]    split + to Nth modified buf
  513.  
  514. 40. :args        list of arguments
  515. 41. :buffers        list of buffers
  516.  
  517. The meaning of [N] depends on the command:
  518.  [N] is number of buffers to go forward/backward on ?2, ?3, and ?4
  519.  [N] is an argument number, defaulting to current argument, for 1 and 21
  520.  [N] is a buffer number, defaulting to current buffer, for 11 and 31
  521.  [N] is a count for 19 and 39
  522.  
  523. Note: ":next" is an exception, because it must accept a list of file names
  524. for compatibility with Vi.
  525.  
  526.  
  527. The argument list and multiple windows
  528. --------------------------------------
  529.  
  530. The current position in the argument list can be different for each window.
  531. Remember that when doing ":e file", the position in the argument list stays
  532. the same, but you are not editing the file at that position.  To indicate
  533. this, the file message (and the title, if you have one) shows
  534. "(file (N) of M)", where "(N)" is the current position in the file list, and
  535. "M" the number of files in the file list.
  536.  
  537. All the entries in the argument list are added to the buffer list.  Thus, you
  538. can also get to them with the buffer list commands, like ":bnext".
  539.  
  540. :[N]al[l][!] [N]                *:al* *:all* *:sal* *:sall*
  541. :[N]sal[l][!] [N]
  542.         Rearrange the screen to open one window for each argument.
  543.         All other windows are closed.  When a count is given, this is
  544.         the maximum number of windows to open.
  545.         When the 'hidden' option is set, all buffers in closed windows
  546.         become hidden.
  547.         When 'hidden' is not set, and the 'autowrite' option is set,
  548.         modified buffers are written.  Otherwise, windows that have
  549.         buffers that are modified are not removed, unless the [!] is
  550.         given, then they become hidden.  But modified buffers are
  551.         never abandoned, so changes cannot get lost.
  552.         Buf/Win Enter/Leave autocommands are not executed for the new
  553.         windows here, that's only done when they are really entered.
  554.  
  555. :[N]sa[rgument][!] [++opt] [+cmd] [N]            *:sa* *:sargument*
  556.         Short for ":split | argument [N]": split window and go to Nth
  557.         argument.  But when there is no such argument, the window is
  558.         not split.  Also see |++opt| and |+cmd|.
  559.  
  560. :[N]sn[ext][!] [++opt] [+cmd] [file ..]            *:sn* *:snext*
  561.         Short for ":split | [N]next": split window and go to Nth next
  562.         argument.  But when there is no next file, the window is not
  563.         split.  Also see |++opt| and |+cmd|.
  564.  
  565. :[N]spr[evious][!] [++opt] [+cmd] [N]            *:spr* *:sprevious*
  566. :[N]sN[ext][!] [++opt] [+cmd] [N]            *:sN* *:sNext*
  567.         Short for ":split | [N]Next": split window and go to Nth
  568.         previous argument.  But when there is no previous file, the
  569.         window is not split.  Also see |++opt| and |+cmd|.
  570.  
  571.                         *:sr* *:srewind*
  572. :sr[ewind][!] [++opt] [+cmd]
  573.         Short for ":split | rewind": split window and go to first
  574.         argument.  But when there is no argument list, the window is
  575.         not split.  Also see |++opt| and |+cmd|.
  576.  
  577.                         *:sfir* *:sfirst*
  578. :sfir[st [++opt] [+cmd]
  579.         Same as ":srewind".
  580.  
  581.                         *:sla* *:slast*
  582. :sla[st][!] [++opt] [+cmd]
  583.         Short for ":split | last": split window and go to last
  584.         argument.  But when there is no argument list, the window is
  585.         not split.  Also see |++opt| and |+cmd|.
  586.  
  587.                         *:dr* *:drop*
  588. :dr[op] {file} ..
  589.         Redefine the argument list to "{file} ..", similar to ":next".
  590.         The first file is edited in the current window if possible.
  591.         If the current buffer can't be |abandon|ed, the window is
  592.         split first.
  593.         The purpose of this command is that it can be used from a
  594.         program that wants Vim to edit another file, e.g., a debugger.
  595.         {only available when compiled with the +gui feature}
  596.  
  597. ==============================================================================
  598. 8. Do a command in all buffers or windows            *list-repeat*
  599.  
  600.                             *:windo*
  601. :windo[!] {cmd}        Execute {cmd} in each window.
  602.             It works like doing this: >
  603.                 CTRL-W t
  604.                 :{cmd}
  605.                 CTRL-W w
  606.                 :{cmd}
  607.                 etc.
  608. <            When an error is detected on one window, further
  609.             windows will not be visited.
  610.             The last window (or where an error occurred) becomes
  611.             the current window.
  612.             {cmd} can contain '|' to concatenate several commands.
  613.             {cmd} must not open or close windows or reorder them.
  614.             Note: While this command is executing, the Syntax
  615.             autocommand event is disabled by adding it to
  616.             'eventignore'.
  617.             {not in Vi} {not available when compiled without the
  618.             |+listcmds| feature}
  619.             Also see |:argdo| and |:bufdo|.
  620.  
  621.                             *:bufdo*
  622. :bufdo[!] {cmd}        Execute {cmd} in each buffer in the buffer list.
  623.             It works like doing this: >
  624.                 :bfirst
  625.                 :{cmd}
  626.                 :bnext
  627.                 :{cmd}
  628.                 etc.
  629. <            When the current file can't be |abandon|ed and the [!]
  630.             is not present, the command fails.
  631.             When an error is detected on one buffer, further
  632.             buffers will not be visited.
  633.             Unlisted buffers are skipped.
  634.             The last buffer (or where an error occurred) becomes
  635.             the current buffer.
  636.             {cmd} can contain '|' to concatenate several commands.
  637.             {cmd} must not delete buffers or add buffers to the
  638.             buffer list.
  639.             Note: While this command is executing, the Syntax
  640.             autocommand event is disabled by adding it to
  641.             'eventignore'.  This considerably speeds up editing
  642.             each buffer.
  643.             {not in Vi} {not available when compiled without the
  644.             |+listcmds| feature}
  645.             Also see |:argdo| and |:windo|.
  646.  
  647. Examples: >
  648.  
  649.     :windo set nolist nofoldcolumn | normal zn
  650.  
  651. This resets the 'list' option and disables folding in all windows. >
  652.  
  653.     :bufdo set fileencoding= | update
  654.  
  655. This resets the 'fileencoding' in each buffer and writes it if this changed
  656. the buffer.  The result is that all buffers will use the 'encoding' encoding
  657. (if conversion works properly).
  658.  
  659. ==============================================================================
  660. 9. Tag or file name under the cursor            *window-tag*
  661.  
  662.                             *:sta* *:stag*
  663. :sta[g][!] [tagname]
  664.         Does ":tag[!] [tagname]" and splits the window for the found
  665.         tag.  See also |:tag|.
  666.  
  667. CTRL-W ]                    *CTRL-W_]* *CTRL-W_CTRL-]*
  668. CTRL-W CTRL-]    Split current window in two.  Use identifier under cursor as a
  669.         tag and jump to it in the new upper window.  Make new window N
  670.         high.
  671.  
  672.                             *CTRL-W_g]*
  673. CTRL-W g ]    Split current window in two.  Use identifier under cursor as a
  674.         tag and perform ":tselect" on it in the new upper window.
  675.         Make new window N high.
  676.  
  677.                             *CTRL-W_g_CTRL-]*
  678. CTRL-W g CTRL-]    Split current window in two.  Use identifier under cursor as a
  679.         tag and perform ":tjump" on it in the new upper window.  Make
  680.         new window N high.
  681.  
  682. CTRL-W f                    *CTRL-W_f* *CTRL-W_CTRL-F*
  683. CTRL-W CTRL-F    Split current window in two.  Edit file name under cursor.
  684.         Like ":split ]f", but window isn't split if the file does not
  685.         exist.
  686.         Uses the 'path' variable as a list of directory names where to
  687.         look for the file.  Also the path for current file is
  688.         used to search for the file name.
  689.         If the name is a hypertext link that looks like
  690.         "type://machine/path", only "/path" is used.
  691.         If a count is given, the count'th matching file is edited.
  692.         {not available when the |+file_in_path| feature was disabled
  693.         at compile time}
  694.  
  695. Also see |CTRL-W_CTRL-I|: open window for an included file that includes
  696. the keyword under the cursor.
  697.  
  698. ==============================================================================
  699. 10. The preview window                *preview-window*
  700.  
  701. The preview window is a special window to show (preview) another file.  It is
  702. normally a small window used to show an include file or definition of a
  703. function.
  704. {not available when compiled without the |+quickfix| feature}
  705.  
  706. There can be only one preview window.  It is created with one of the commands
  707. below.  The 'previewheight' option can be set to specify the height of the
  708. preview window when it's opened.  The 'previewwindow' option is set in the
  709. preview window to be able to recognize it.
  710.  
  711.                         *:pta* *:ptag*
  712. :pta[g][!] [tagname]
  713.         Does ":tag[!] [tagname]" and shows the found tag in a
  714.         "Preview" window without changing the current buffer or cursor
  715.         position. If a "Preview" window already exists, it is re-used
  716.         (like a help window is).  If a new one is opened,
  717.         'previewheight' is used for the height of the window.   See
  718.         also |:tag|.
  719.         See below for an example. |CursorHold-example|
  720.  
  721. CTRL-W z                    *CTRL-W_z*
  722. CTRL-W CTRL-Z                    *CTRL-W_CTRL-Z* *:pc* *:pclose*
  723. :pc[lose][!]    Close any "Preview" window currently open.  When the 'hidden'
  724.         option is set, or when the buffer was changed and the [!] is
  725.         used, the buffer becomes hidden (unless there is another
  726.         window editing it).  The command fails if any "Preview" buffer
  727.         cannot be closed.  See also |:close|.
  728.  
  729.                             *:pp* *:ppop*
  730. :[count]pp[op][!]
  731.         Does ":[count]pop[!]" in the preview window.  See |:pop| and
  732.         |:ptag|.  {not in Vi}
  733.  
  734. CTRL-W }                        *CTRL-W_}*
  735.         Use identifier under cursor as a tag and perform a :ptag on
  736.         it. Make the new Preview window (if required) N high.  If N is
  737.         not given, 'previewheight' is used.
  738.  
  739. CTRL-W g }                        *CTRL-W_g}*
  740.         Use identifier under cursor as a tag and perform a :ptjump on
  741.         it. Make the new Preview window (if required) N high.  If N is
  742.         not given, 'previewheight' is used.
  743.  
  744.                             *:ped* *:pedit*
  745. :ped[it][!] [++opt] [+cmd] {file}
  746.         Edit {file} in the preview window.  The preview window is
  747.         opened like with |:ptag|.  The current window and cursor
  748.         position isn't changed.  Useful example: >
  749.             :pedit +/fputc /usr/include/stdio.h
  750. <
  751.                             *:ps* *:psearch*
  752. :[range]ps[earch][!] [count] [/]pattern[/]
  753.         Works like |:ijump| but shows the found match in the preview
  754.         window.  The preview window is opened like with |:ptag|.  The
  755.         current window and cursor position isn't changed.  Useful
  756.         example: >
  757.             :psearch popen
  758. <        Like with the |:ptag| command, you can use this to
  759.         automatically show information about the word under the
  760.         cursor.  This is less clever than using |:ptag|, but you don't
  761.         need a tags file and it will also find matches in system
  762.         include files.  Example: >
  763.   :au! CursorHold *.[ch] nested exe "silent! psearch " . expand("<cword>")
  764. <        Warning: This can be slow.
  765.  
  766. Example                        *CursorHold-example*  >
  767.  
  768.   :au! CursorHold *.[ch] nested exe "silent! ptag " . expand("<cword>")
  769.  
  770. This will cause a ":ptag" to be executed for the keyword under the cursor,
  771. when the cursor hasn't moved for the time set with 'updatetime'.  The "nested"
  772. makes other autocommands be executed, so that syntax highlighting works in the
  773. preview window.  The "silent!" avoids an error message when the tag could not
  774. be found.  Also see |CursorHold|.  To disable this again: >
  775.  
  776.   :au! CursorHold
  777.  
  778. A nice addition is to highlight the found tag, avoid the ":ptag" when there
  779. is no word under the cursor, and a few other things: >
  780.  
  781.   :au! CursorHold *.[ch] nested call PreviewWord()
  782.   :func PreviewWord()
  783.   :  if &previewwindow            " don't do this in the preview window
  784.   :    return
  785.   :  endif
  786.   :  let w = expand("<cword>")        " get the word under cursor
  787.   :  if w != ""                " if there is one ":ptag" to it
  788.   :
  789.   :    " Delete any existing highlight before showing another tag
  790.   :    silent! wincmd P            " jump to preview window
  791.   :    if &previewwindow            " if we really get there...
  792.   :      match none            " delete existing highlight
  793.   :      wincmd p            " back to old window
  794.   :    endif
  795.   :
  796.   :    " Try displaying a matching tag for the word under the cursor
  797.   :    let v:errmsg = ""
  798.   :    exe "silent! ptag " . w
  799.   :    if v:errmsg =~ "tag not found"
  800.   :      return
  801.   :    endif
  802.   :
  803.   :    silent! wincmd P            " jump to preview window
  804.   :    if &previewwindow        " if we really get there...
  805.   :     if has("folding")
  806.   :       silent! .foldopen        " don't want a closed fold
  807.   :     endif
  808.   :     call search("$", "b")        " to end of previous line
  809.   :     let w = substitute(w, '\\', '\\\\', "")
  810.   :     call search('\<\V' . w . '\>')    " position cursor on match
  811.   :     " Add a match highlight to the word at this position
  812.   :      hi previewWord term=bold ctermbg=green guibg=green
  813.   :     exe 'match previewWord "\%' . line(".") . 'l\%' . col(".") . 'c\k*"'
  814.   :      wincmd p            " back to old window
  815.   :    endif
  816.   :  endif
  817.   :endfun
  818.  
  819. ==============================================================================
  820. 11. Using hidden buffers                *buffer-hidden*
  821.  
  822. A hidden buffer is not displayed in a window, but is still loaded into memory.
  823. This makes it possible to jump from file to file, without the need to read or
  824. write the file every time you get another buffer in a window.
  825. {not available when compiled without the |+listcmds| feature}
  826.  
  827.                             *:buffer-!*
  828. If the option 'hidden' ('hid') is set, abandoned buffers are kept for all
  829. commands that start editing another file: ":edit", ":next", ":tag", etc.  The
  830. commands that move through the buffer list sometimes make the current buffer
  831. hidden although the 'hidden' option is not set.  This happens when a buffer is
  832. modified, but is forced (with '!') to be removed from a window, and
  833. 'autowrite' is off or the buffer can't be written.
  834.  
  835. You can make a hidden buffer not hidden by starting to edit it with any
  836. command.  Or by deleting it with the ":bdelete" command.
  837.  
  838. The 'hidden' is global, it is used for all buffers.  The 'bufhidden' option
  839. can be used to make an exception for a specific buffer.  It can take these
  840. values:
  841.     <empty>        Use the value of 'hidden'.
  842.     hide        Hide this buffer, also when 'hidden' is not set.
  843.     unload        Don't hide but unload this buffer, also when 'hidden'
  844.             is set.
  845.     delete        Delete the buffer.
  846.  
  847.                             *hidden-quit*
  848. When you try to quit Vim while there is a hidden, modified buffer, you will
  849. get an error message and Vim will make that buffer the current buffer.  You
  850. can then decide to write this buffer (":wq") or quit without writing (":q!").
  851. Be careful: there may be more hidden, modified buffers!
  852.  
  853. A buffer can also be unlisted.  This means it exists, but it is not in the
  854. list of buffers. |unlisted-buffer|
  855.  
  856.  
  857. :files[!]                    *:files*
  858. :buffers[!]                    *:buffers* *:ls*
  859. :ls[!]        Show all buffers.  Example: >
  860.  
  861.             1 #h  "/test/text"        line 1
  862.             2u    "asdf"            line 0
  863.             3 %l+ "version.c"        line 1
  864. <
  865.         When the [!] is included the list will show unlisted buffers
  866.         (the term "unlisted" is a bit confusing then...).
  867.  
  868.         Each buffer has a unique number.  That number will not change,
  869.         so you can always go to a specific buffer with ":buffer N" or
  870.         "N CTRL-^", where N is the buffer number.
  871.  
  872.         Indicators (chars in the same column are mutually exclusive):
  873.         u    an unlisted buffer (only displayed when [!] is used)
  874.                |unlisted-buffer|
  875.          %    the buffer in the current window
  876.          #    the alternate buffer for ":e #" and CTRL-^
  877.           a    an active buffer: it is loaded and visible
  878.           h    a hidden buffer: It is loaded, but currently not
  879.                displayed in a window |hidden-buffer|
  880.            -    a buffer with 'modifiable' off
  881.             =    a readonly buffer
  882.              +    a modified buffer
  883.  
  884.                         *:bad* *:badd*
  885. :bad[d]    [+lnum] {fname}
  886.         Add file name {fname} to the buffer list, without loading it.
  887.         If "lnum" is specified, the cursor will be positioned at that
  888.         line when the buffer is first entered. Note that other
  889.         commands after the + will be ignored.
  890.  
  891. :[N]bd[elete][!]                *:bd* *:bdel* *:bdelete*
  892. :bd[elete][!] [N]
  893.         Unload buffer [N] (default: current buffer) and delete it from
  894.         the buffer list.  If the buffer was changed, this fails,
  895.         unless when [!] is specified, in which case changes are lost.
  896.         The file remains unaffected.  Any windows for this buffer are
  897.         closed.  If buffer [N] is the current buffer, another buffer
  898.         will be displayed instead.  This is the most recent entry in
  899.         the jump list that points into a loaded buffer.
  900.         Actually, the buffer isn't completely deleted, it is removed
  901.         from the buffer list |unlisted-buffer|.  Option values and
  902.         local variables are cleared.
  903.  
  904. :bdelete[!] {bufname}                        *E93* *E94*
  905.         Like ":bdelete[!] [N]", but buffer given by name.  Note that a
  906.         buffer whose name is a number cannot be referenced by that
  907.         name; use the buffer number instead.  Insert a backslash
  908.         before a space in a buffer name.
  909.  
  910. :bdelete[!] N1 N2 ...
  911.         Do ":bdelete[!]" for buffer N1, N2, etc.  The arguments can be
  912.         buffer numbers or buffer names (but not buffer names that are
  913.         a number).  Insert a backslash before a space in a buffer
  914.         name.
  915.  
  916. :N,Mbdelete[!]    Do ":bdelete[!]" for all buffers in the range N to M
  917.         (inclusive).
  918.  
  919. :[N]bw[ipeout][!]                *:bw* *:bwipe* *:bwipeout*
  920. :bw[ipeout][!] {bufname}
  921. :N,Mbw[ipeout][!]
  922. :bw[ipeout][!] N1 N2 ...
  923.         Like ":bdelete", but really delete the buffer.  All marks in
  924.         this buffer become invalid, option settings are lost, etc.
  925.         Don't use this unless you know what you are doing.
  926.  
  927. :[N]bun[load][!]                    *:bun* *:bunload*
  928. :bun[load][!] [N]
  929.         Unload buffer [N] (default: current buffer).  The memory
  930.         allocated for this buffer will be freed.  The buffer remains
  931.         in the buffer list.
  932.         If the buffer was changed, this fails, unless when [!] is
  933.         specified, in which case the changes are lost.
  934.         Any windows for this buffer are closed.  If buffer [N] is the
  935.         current buffer, another buffer will be displayed instead.
  936.         This is the most recent entry in the jump list that points
  937.         into a loaded buffer.
  938.  
  939. :bunload[!] {bufname}
  940.         Like ":bunload[!] [N]", but buffer given by name.  Note that a
  941.         buffer whose name is a number cannot be referenced by that
  942.         name; use the buffer number instead.  Insert a backslash
  943.         before a space in a buffer name.
  944.  
  945. :N,Mbunload[!]    Do ":bunload[!]" for all buffers in the range N to M
  946.         (inclusive).
  947.  
  948. :bunload[!] N1 N2 ...
  949.         Do ":bunload[!]" for buffer N1, N2, etc.  The arguments can be
  950.         buffer numbers or buffer names (but not buffer names that are
  951.         a number).  Insert a backslash before a space in a buffer
  952.         name.
  953.  
  954. :[N]b[uffer][!] [N]            *:b* *:bu* *:buf* *:buffer* *E86*
  955.         Edit buffer [N] from the buffer list.  If [N] is not given,
  956.         the current buffer remains being edited.  See |:buffer-!| for
  957.         [!].  This will also edit a buffer that is not in the buffer
  958.         list, without setting the 'buflisted' flag.
  959.  
  960. :[N]b[uffer][!] {filename}
  961.         Edit buffer for {filename} from the buffer list.  See
  962.         |:buffer-!| for [!].  This will also edit a buffer that is not
  963.         in the buffer list, without setting the 'buflisted' flag.
  964.  
  965. :[N]sb[uffer] [N]                    *:sb* *:sbuffer*
  966.         Split window and edit buffer [N] from the buffer list.  If [N]
  967.         is not given, the current buffer is edited.  Respects the
  968.         "useopen" setting of 'switchbuf' when splitting.  This will
  969.         also edit a buffer that is not in the buffer list, without
  970.         setting the 'buflisted' flag.
  971.  
  972. :[N]sb[uffer] {filename}
  973.         Split window and edit buffer for {filename} from the buffer
  974.         list.  This will also edit a buffer that is not in the buffer
  975.         list, without setting the 'buflisted' flag.
  976.  
  977.                             *:bn* *:bnext* *E87*
  978. :[N]bn[ext][!] [N]
  979.         Go to [N]th next buffer in buffer list.  [N] defaults to one.
  980.         Wraps around the end of the buffer list.
  981.         See |:buffer-!| for [!].
  982.         If you are in a help buffer, this takes you to the next help
  983.         buffer (if there is one).  Similarly, if you are in a normal
  984.         (non-help) buffer, this takes you to the next normal buffer.
  985.         This is so that if you have invoked help, it doesn't get in
  986.         the way when you're browsing code/text buffers. The next three
  987.         commands also work like this.
  988.  
  989.                             *:sbn* *:sbnext*
  990. :[N]sbn[ext] [N]
  991.         Split window and go to [N]th next buffer in buffer list.
  992.         Wraps around the end of the buffer list.  Uses 'switchbuf'
  993.  
  994. :[N]bN[ext][!] [N]            *:bN* *:bNext* *:bp* *:bprevious* *E88*
  995. :[N]bp[revious][!] [N]
  996.         Go to [N]th previous buffer in buffer list.  [N] defaults to
  997.         one.  Wraps around the start of the buffer list.
  998.         See |:buffer-!| for [!] and 'switchbuf'.
  999.  
  1000. :[N]sbN[ext] [N]            *:sbN* *:sbNext* *:sbp* *:sbprevious*
  1001. :[N]sbp[revious] [N]
  1002.         Split window and go to [N]th previous buffer in buffer list.
  1003.         Wraps around the start of the buffer list.
  1004.         Uses 'switchbuf'.
  1005.  
  1006.                             *:br* *:brewind*
  1007. :br[ewind][!]    Go to first buffer in buffer list.  If the buffer list is
  1008.         empty, go to the first unlisted buffer.
  1009.         See |:buffer-!| for [!].
  1010.  
  1011.                             *:bf* *:bfirst*
  1012. :bf[irst    Same as ":brewind".
  1013.  
  1014.                             *:sbr* *:sbrewind*
  1015. :sbr[ewind]    Split window and go to first buffer in buffer list.  If the
  1016.         buffer list is empty, go to the first unlisted buffer.
  1017.         Respects the 'switchbuf' option.
  1018.  
  1019.                             *:sbf* *:sbfirst*
  1020. :sbf[irst]    Same as ":sbrewind".
  1021.  
  1022.                             *:bl* *:blast*
  1023. :bl[ast][!]    Go to last buffer in buffer list.  If the buffer list is
  1024.         empty, go to the last unlisted buffer.
  1025.         See |:buffer-!| for [!].
  1026.  
  1027.                             *:sbl* *:sblast*
  1028. :sbl[ast]    Split window and go to last buffer in buffer list.  If the
  1029.         buffer list is empty, go to the last unlisted buffer.
  1030.         Respects 'switchbuf' option.
  1031.  
  1032. :[N]bm[odified][!] [N]                *:bm* *:bmodified* *E84*
  1033.         Go to [N]th next modified buffer.  Note: this command also
  1034.         finds unlisted buffers.  If there is no modified buffer the
  1035.         command fails.
  1036.  
  1037. :[N]sbm[odified] [N]                    *:sbm* *:sbmodified*
  1038.         Split window and go to [N]th next modified buffer.
  1039.         Respects 'switchbuf' option.
  1040.         Note: this command also finds buffers not in the buffer list.
  1041.  
  1042. :[N]unh[ide] [N]            *:unh* *:unhide* *:sun* *:sunhide*
  1043. :[N]sun[hide] [N]
  1044.         Rearrange the screen to open one window for each loaded buffer
  1045.         in the buffer list.  When a count is given, this is the
  1046.         maximum number of windows to open.
  1047.  
  1048. :[N]ba[ll] [N]                    *:ba* *:ball* *:sba* *:sball*
  1049. :[N]sba[ll] [N]    Rearrange the screen to open one window for each buffer in
  1050.         the buffer list.  When a count is given, this is the maximum
  1051.         number of windows to open.  Buf/Win Enter/Leave autocommands
  1052.         are not executed for the new windows here, that's only done
  1053.         when they are really entered.
  1054.  
  1055. Note: All the commands above that start editing another buffer, keep the
  1056. 'readonly' flag as it was.  This differs from the ":edit" command, which sets
  1057. the 'readonly' flag each time the file is read.
  1058.  
  1059. ==============================================================================
  1060. 12. Special kinds of buffers            *special-buffers*
  1061.  
  1062. Instead of containing the text of a file, buffers can also be used for other
  1063. purposes.  A few options can be set to change the behavior of a buffer:
  1064.     'bufhidden'    what happens when the buffer is no longer displayed
  1065.             in a window.
  1066.     'buftype'    what kind of a buffer this is
  1067.     'swapfile'    whether the buffer will have a swap file
  1068.     'buflisted'    buffer shows up in the buffer list
  1069.  
  1070. A few useful kinds of a buffer:
  1071.  
  1072. quickfix    Used to contain the error list.  See |:cwindow|.  This command
  1073.         sets the 'buftype' option to "quickfix".  You are not supposed
  1074.         to change this!  'swapfile' is off.
  1075.  
  1076. help        Contains a help file.  Will only be created with the |:help|
  1077.         command.  The flag that indicates a help buffer is internal
  1078.         and can't be changed.  The 'buflisted' option will be reset
  1079.         for a help buffer.
  1080.  
  1081. directory    Displays directory contents.  Used by the |file-explorer|
  1082.         plugin.  The buffer is created with these settings: >
  1083.             :set buftype=nowrite
  1084.             :set bufhidden=delete
  1085.             :set noswapfile
  1086. <        The buffer name is the name of the directory and is adjusted
  1087.         when using the |:cd| command.
  1088.  
  1089. scratch        Contains text that can be discarded at any time.  It is kept
  1090.         when closing the window, it must be deleted explicitly.
  1091.         Settings: >
  1092.             :set buftype=nofile
  1093.             :set bufhidden=hide
  1094.             :set noswapfile
  1095. <        The buffer name can be used to identify the buffer.
  1096.  
  1097.                         *unlisted-buffer*
  1098. unlisted    The buffer is not in the buffer list.  It is not used for
  1099.         normal editing, but to show a help file, remember a file name
  1100.         or marks.  The ":bdelete" command will also set this option,
  1101.         thus it doesn't completely delete the buffer.  Settings: >
  1102.             :set nobuflisted
  1103. <
  1104.  
  1105.  vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:
  1106.